<template>
  <!-- 子 -->
  <div>
    子组件<input type="text"
           v-model="name">
    <br>
    <span>父亲传的值：{{names}}</span>
    <!-- <button @click="send">发送</button> -->
    <button @click="$emit('update:names',name)">发送</button>
  </div>
</template>

<script>
export default {
  // props: ['names']
  props: {
    names: {
      type: String
    },
  },
  data () {
    return {
      name: ''
    }
  },
  methods: {
    send () {
      this.$emit('toFathers', this.name)
    }
  },
}
</script>

<style>
</style>